<template>
    <div class="search-input-component">
    	<h3>快捷查询</h3>
		<Row class-name="input-label" :gutter="30">
			<Col span="4">活动ID</Col>
			<Col span="4">活动名称</Col>
			<Col span="4">创建人</Col>
			<Col span="6">创建部门</Col>
			<Col span="4"></Col>
		</Row>
	   <Row :gutter="30">
			<Col span="4"> <Input size="large" placeholder="请输入活动ID"   :maxlength="50" :value="activityId" @on-change="changeActivityId"></Input></Col>
			<Col span="4"> <Input size="large" placeholder="请输入活动名称" :maxlength="50" :value="activityName"></Input></Col>
			<Col span="4"> <Input size="large" placeholder="请输入活动创建人" :maxlength="50" :value="creator"></Input></Col>
			<Col span="6"> <Cascader size="large" :data="department" :load-data="loadData"></Cascader></Col>
			<Col span="4"> <Button type="primary" @click="searchActivityList" :loading="buttonLoading">查询</Button></Col>
	   </Row>
    </div>
</template>

<script>
    import { mapGetters, mapActions } from 'vuex'
    export default {
        data () {
            return {
                data4: [
                    {
                        value: 'beijing',
                        label: '北京',
                        children: [],
                        loading: false
                    },
                    {
                        value: 'hangzhou',
                        label: '杭州',
                        children: [],
                        loading:false
                    }
                ]
            }
        },
        computed: {
            ...mapGetters({
                activityId: 'activityId',
                activityName:'activityName',
                creator:'creator',
                department:'department',
				child:'child',
                buttonLoading:'buttonLoading'
            }),
            total () {

            }
        },
        methods: {
			...mapActions([
			    'changeActivityId',
				'searchActivityList'
			]),
            loadData (item, callback) {
				let obj = {value:item.value,callback:callback}
			    this.$store.dispatch('fethChildDepartment',obj)
				callback();
            }
        }
    }
</script>

<style scoped>

  .search-input-component{
  	margin:15px 0;
  }

  .input-label{
  	margin: 15px 0 10px 0;
  }
</style>
